package com.arvin.mapper;

import com.arvin.pojo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {


    @Insert("insert into t_contest(con_name, studentId_id, con_time) values (#{conName} ,#{studentId} ,#{conTime} )")
    void saveContest(Contest contest1);

    void saveStudent(Student studentInfo);

    /**
     * 通过学号查找学生信息
     * @param studentId
     * @return
     */
    Student findByStudentId(String studentId);

    /**
     * 通过学号查询竞赛信息
     * @param studentId
     * @return
     */
    @Select("select * from t_contest where studentId_id =#{studentId} ")
    List<Contest> findByStudentIdToContest(String studentId);

    /**
     * 删除竞赛id
     * @param studentId
     */
    @Delete("delete from t_contest where studentId_id = #{studentId}")
    void deleteContest(String studentId);

}
